/**
 * 
 */
package com.vivid.dynamics.oknow.model;

/**
 *
 * @author jason
 * created at:: Aug 12, 2011 3:18:08 PM
 */
public class UserCategory {
	private int id;
	private User user;
	//private int ordering; userCatIdx
	private String keyMeta;
	
	// OWNER is User side, so no association method on this side~
	
	/**
	 * ctor. For Hibernate reflection
	 */
	protected UserCategory() {}
	/**
	 * ctor
	 * @param keyMeta
	 */
	public UserCategory(String keyMeta) {
		super();
		//this.ordering = ordering;
		this.keyMeta = keyMeta;
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public String toString() {
		return "UserCategory [id=" + id + ", keyMeta=" + keyMeta + "]";
	}
	
	/**
	 * {@inheritDoc} 
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		/*result = prime * result + ((keyMeta == null) ? 0 : keyMeta.hashCode());
		result = prime * result + ordering;*/
		return result;
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UserCategory other = (UserCategory) obj;
		if (id != other.id)
			return false;
		if (keyMeta == null) {
			if (other.keyMeta != null)
				return false;
		} else if (!keyMeta.equals(other.keyMeta))
			return false;
		/*if (ordering != other.ordering)
			return false;*/
		return true;
	}
	
	/* ********************** */
	/* *  accessor/mutator  * */
	/* ********************** */
	
	/**
	 * 
	 * @return
	 * @author jason
	 * created at:: Aug 12, 2011  3:22:36 PM
	 */
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	/**
	 * 
	 * @return
	 * @author jason
	 * created at:: Aug 12, 2011  3:23:20 PM
	 */
	public User getUser() {
		return user;
	}
	protected void setUser(User user) {
		this.user = user;
	}
	
	/**
	 * 
	 * @return
	 * @author jason
	 * created at:: Aug 12, 2011  3:23:29 PM
	 */
	public String getKeyMeta() {
		return keyMeta;
	}
	public void setKeyMeta(String keyMeta) {
		this.keyMeta = keyMeta;
	}
	
}
